package com.ndp.fb.rdb.api;

import com.ndp.fb.rdb.model.Adword;
import com.ndp.fb.rdb.model.Dictionary;
import com.ndp.fb.rdb.model.Pager;

import java.util.List;

/**
 * Created by Jacky on 2015/1/29.
 */
public interface AdwordRdbService {

    /**
     * 保存广告词
     *
     * @param adword
     * @return
     */
    Long saveAdword(Adword adword);

    void deleteByIdAndUserId(String userId, Long id);

    Adword findAdwordById(long id);

    List<Dictionary> searchLanguageByApp(long productId, Long orgId);

    List<Dictionary> searchLanguageByAppEN(long productId, Long orgId);

    List<Dictionary> searchLanguageByOrg(Long orgId);

    List<Dictionary> searchLanguageByOrgEN(Long orgId);

    List<Adword> findByOrgIdAndDictId(Long orgId, Long languageId);

    Pager<?> findPagerByOrgIdAndDictId(Long orgId, Long languageId, int firstResult, int sizeNo);

    Pager<?> findPagerByFbConnectionObjectIdAndOrgIdAndDictId(Long fbConnectionObjectId, Long orgId, Long languageId, int firstResult, int sizeNo);

    Adword findAdwordByOrgIdAndDictIdAndDescriptionAndWord(Long orgId, Long languageId, String description, String word);

    List<Adword> findByProductIdAndOrgIdAndLanaguage(Long productId, Long orgId, Long languageId);

    Pager<Adword> findPagerByProductIdAndOrgIdAndDictId(Long productId, Long orgId, Long languageId, int firstResult, int sizeNo);

    Adword findByProductIdAndOrgIdAndLanaguageAndWord(Long productId, Long orgId, Long languageId, String word);

    Adword findRandomForRobot(Long orgId,Long productId);
    
    Adword findRandomForRobot(Long orgId,Long productId,List<String> language);

    List<Adword> findAdwordByProductId(Long productId);

    List<Dictionary> searchLanguageByOrg(Long orgId, String dicType);

    List<Dictionary> searchLanguageByApp(Long fbConnectionObjectId, Long orgId, String dicType);

    List<Dictionary> searchLanguageByOrgEN(Long orgId, String dicType);

    List<Dictionary> searchLanguageByAppEN(Long fbConnectionObjectId, Long orgId, String dicType);
}
